<template>
   <el-dialog
    v-model="visible"
    :close-on-click-modal="false"
    :before-close="hangleCloseDialog"
    :style="isPreview ? 'background-color: #1f406c;' : ''"
    align-center
  >
    <slot></slot>

    <template #footer>
      <slot name="footer"></slot>
    </template>
  </el-dialog>
</template>

<script lang="ts" setup>import { computed } from 'vue';

const props = defineProps(['visible', 'isPreview']);
const emits = defineEmits(['close']);

const visible = computed({
  get: () => props.visible,
  set: () => emits("close")
})

const hangleCloseDialog = () => {
  // emits('update:modelValue', false);
  emits("close");
};
</script>